//
//  HeadEditView.swift
//  ShiZhe
//
//  Created by 陈卿伟 on 16/10/8.
//  Copyright © 2016年 陈卿伟. All rights reserved.
//

import UIKit

class HeadEditView: UIView {
    var cancelButton:UIButton!//取消按钮
    var publishButton:UIButton!//发布按钮
    override init(frame: CGRect) {
        cancelButton = UIButton()
        publishButton = UIButton()
        super.init(frame: frame)
        self.backgroundColor = UIColor.whiteColor()
        self.createCancelButton()
        self.createPublishButton()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //创建左边的取消按钮
    func createCancelButton(){
        cancelButton.frame = CGRectMake(20*SCALEW, 34, 40, 19)
        cancelButton.setTitle("取消", forState: .Normal)
        cancelButton.setTitleColor(Theme.editBlue, forState: .Normal)
        self.addSubview(cancelButton)
    }
    
    //添加右边的发布按钮
    func createPublishButton(){
        publishButton.frame = CGRectMake(315*SCALEW, 34, 40, 19)
        publishButton.setTitle("发布", forState: .Normal)
        publishButton.setTitleColor(Theme.editBlue, forState: .Normal)
        self.addSubview(publishButton)
    }
}








